package com.onesports.intelligent.k12.polarlight.mapper.organization;


import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.onesports.intelligent.k12.polarlight.annotation.DataPermission;
import com.onesports.intelligent.k12.polarlight.domain.dto.organization.CoachCampusRelDTO;
import com.onesports.intelligent.k12.polarlight.domain.entity.organization.CoachCampusRel;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 教练社区(校区)关联表
 *
 * @author
 * @since 1.0.0 2022-07-08
 */
@Mapper
public interface CoachCampusRelMapper extends BaseMapper<CoachCampusRel> {

    /**
     * function: 查询教练数量
     *
     * @param campusId 校区id
     * @return 校区下教练数量
     * @author WangCX
     * @since 2022/8/3 11:34
     */
    Long selectCoachNumber(@Param("campusId") String campusId);


    /**
     * function:机构端查看当前教练校区关联排序是否已存在
     *
     * @param dto 教练关联校区
     * @return 是否已存在排序
     * @author WangCX
     * @since 2022/8/3 15:13
     */
    Long countCampusRel(@Param("dto")CoachCampusRelDTO dto);

    @DataPermission
    List<CoachCampusRel> selectAuthCoachCampusRel();
}
